{% extends 'layout.html' %}

{% block title %}
    靓号列表
{% endblock title %}

{% block content %}
    <div class="container">

        {# 搜索部分 #}
        <nav class="navbar navbar-default">
            <div class="container-fluid">
                <div class="navbar-header">
                    {#新建按钮#}
                    <a class="btn btn-success navbar-btn" href="/pretty/add/">
                        <span class="glyphicon glyphicon-plus-sign" aria-hidden="true"></span>
                        新建靓号
                    </a>
                </div>

                {# 搜索部分 #}
                <div style="float: right">
                    <form class="navbar-form navbar-left">
                        <div class="form-group">
                            <label>手机号：</label>
                            <input type="text" class="form-control " placeholder="Search" name="sc_mobile"
                                   value="{{ mobile }}">
                            <label>级别：</label>
                            <input type="text" class="form-control" placeholder="Search" name="sc_level"
                                   value="{{ level }}">
                        </div>
                        <button type="submit" class="btn btn-default">
                            <span class="glyphicon glyphicon-search" aria-hidden="true"></span>
                            查找
                        </button>
                    </form>
                </div>
            </div>
        </nav>

        {#面板#}
        <div class="panel panel-default">
            <!-- Default panel contents -->
            <div class="panel-heading">
                <span class="glyphicon glyphicon-th-list" aria-hidden="true"></span>
                靓号列表
            </div>

            <!-- Table -->
            <table class="table table-bordered table-striped table-hover">
                <thead>
                <tr>
                    <th>序号</th>
                    <th>ID</th>
                    <th>号码</th>
                    <th>价格</th>
                    <th>级别</th>
                    <th>状态</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                {% for obj in queryset %}
                    <tr>
                        <th>{{ forloop.counter }}</th>
                        <td>{{ obj.id }}</td>
                        <td>{{ obj.mobile }}</td>
                        <td>{{ obj.price }}</td>
                        <td>{{ obj.get_level_display }}</td>
                        <td>{{ obj.get_status_display }}</td>
                        <td>
                            <a href="/pretty/{{ obj.id }}/edit" class="btn btn-primary btn-xs">编辑</a>
                            <a href="/pretty/{{ obj.id }}/delete" class="btn btn-danger btn-xs">删除</a>
                        </td>
                    </tr>
                {% endfor %}
                </tbody>
            </table>
        </div>

        {# 分页 #}
        <div class="clearfix">
            <ul class="pagination">
                {{ page_string }}
            </ul>
        </div>

    </div>
{% endblock content %}